package com.example.mykotilin.livedata

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.activity.viewModels
import androidx.databinding.DataBindingUtil
import com.example.mykotilin.R
import com.example.mykotilin.databinding.ActivityLivedataBinding

class LiveDataActivity : AppCompatActivity() {
    private val viewModel: LiveDataViewModel by viewModels {
        LiveDataVMFactory
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
//        setContentView(R.layout.activity_livedata)
        val binding = DataBindingUtil.setContentView<ActivityLivedataBinding>(
            this, R.layout.activity_livedata
        )

        binding.lifecycleOwner = this
        binding.viewmodel = viewModel

    }

}